//
//  SingerDetailCell.m
//  Coco_Music
//
//  Created by dlios on 15-6-24.
//  Copyright (c) 2015年 寇广超. All rights reserved.
//

#import "SingerDetailCell.h"

@implementation SingerDetailCell
-(void)dealloc
{
    [_myImageView release];
    [_SingerLabel release];
    [_singerD release];
    [super dealloc];
    
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self =[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubViews];
    }
    return self;
    
}
-(void)createSubViews
{
    self.myImageView =[[UIImageView alloc]initWithFrame:CGRectMake(5, 5, [UIScreen mainScreen].bounds.size.width/4, [UIScreen mainScreen].bounds.size.width/4)];
    self.myImageView.backgroundColor=[UIColor blackColor];
    [self addSubview:self.myImageView];
    [_myImageView release];
    
    

    self.myImageView.layer.masksToBounds =YES;
    self.myImageView.layer.cornerRadius =20;
    self.myImageView.layer.borderWidth =3;
    self.myImageView.layer.borderColor =[[UIColor colorWithRed:0.6 green:0.4 blue:0.4 alpha:0.6]CGColor];
    
    self.SingerLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.myImageView.frame.origin.x+self.myImageView.frame.size.width+50, 20,[UIScreen mainScreen].bounds.size.width/2, 40)];
    
    self.SingerLabel.font =[UIFont systemFontOfSize:20];
    
    self.SingerLabel.textColor = [UIColor colorWithRed:0.6 green:0.4 blue:0.4 alpha:0.6];
    [self addSubview:self.SingerLabel];
    [_SingerLabel release];
    

    
    self.SingerLabel =[[UILabel alloc]initWithFrame:CGRectMake(self.myImageView.frame.origin.x+self.myImageView.frame.size.width+50, 20,[UIScreen mainScreen].bounds.size.width/2, 40)];
    
    self.SingerLabel.font =[UIFont systemFontOfSize:15];
    self.SingerLabel.textColor = [UIColor blackColor];
    [self addSubview:self.SingerLabel];
    [_SingerLabel release];
    
   UIImageView *ImageLine = [[UIImageView alloc]initWithFrame:CGRectMake(_myImageView.frame.size.width+20, self.myImageView.frame.size.height+self.myImageView.frame.origin.x+5, [UIScreen mainScreen].bounds.size.width-_myImageView.frame.size.width-40, 1)];
    ImageLine.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:ImageLine];
    [ImageLine release];

    
}
-(void)setSingerD:(SingerDetail *)singerD
{
    if (_singerD != singerD) {
        [_singerD release];
     _singerD =  [singerD retain];
    }
    NSURL *url =[NSURL URLWithString:singerD.pic_url];

    [self.myImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"myLogo.png"]];

    [self.myImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"cm2_default_artist_banner-1"]];

    self.SingerLabel.text =    singerD.singer_name;
    
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
